//
//  HMBaseNavController.m
//  HowToDo
//
//  Created by 胡坤 on 2017/1/4.
//  Copyright © 2017年 KY. All rights reserved.
//

#import "HMBaseNavController.h"

@interface HMBaseNavController ()

@property(strong,nonatomic)UIImageView *leftBarButtonImageView;


@end

@implementation HMBaseNavController

- (void)viewDidLoad {
    [super viewDidLoad];
//    设置主题色
    [UINavigationBar appearance].tintColor = [UIColor colorWithHex:0x999999];

}

#warning mark - 设置导航控制器的根控制器时也会调用push方法
// 重写导航控制器的push方法拦截它push过程
- (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated {
    
    //    NSLog(@" --------%@", [viewController class]);
    
    // 只有导航控制器的非根控制器才需要隐藏tabBar
    if (self.childViewControllers.count > 0) {
        // 隐藏tabBar
        viewController.hidesBottomBarWhenPushed = YES;
    }
    
    [super pushViewController:viewController animated:animated];
}
//
//
//- (void)setLeftBarButtonItemWithImage:(UIImage *)image {
//    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:[self leftBarButtonImageViewWithImage:image]];
//    
//}
//
//- (UIImageView *)leftBarButtonImageViewWithImage:(UIImage *)image {
//    if (_leftBarButtonImageView == nil) {
//        _leftBarButtonImageView = [[UIImageView alloc]initWithImage:image];
//        
//        _leftBarButtonImageView.contentMode = UIViewContentModeRight;
//        _leftBarButtonImageView.frame = CGRectMake(0, 0, 35, 35);
//    }
//    return _leftBarButtonImageView;
//}
@end
